var o = {};

var faq = new Function();
faq.prototype = o;

/**
 * 加载评论
 */
o.loadFaq=function(fkId,pNo){
	$('#faqContainer').load(ROOT+"/faq/faq-loadFaq.action?fkId="+fkId+"&currentPage="+pNo);
}
o.loadFileFaq=function(fkId,pNo){
	$('#faqContainer').load(ROOT+"/faq/faq-loadFileFaq.action?fkId="+fkId+"&currentPage="+pNo);
}
/**
 * 打开回复
 */
o.loadFeedback=function(faqId){
	$('#feedbackDiv'+faqId).load(ROOT+"/faq/faq-loadFeedback.action?faqId="+faqId);
}
/**
 * 关闭回复
 */
o.closeFeedback=function(faqId){
	$('#feedbackDiv'+faqId).html("");
}
/**
 * 回复
 */
o.feedback=function(faqId,content){
	feedback(faqId,content);
}
 /**
  * 选择
  */
 o.checkAll = function(obj) {
 	if (obj.attr('checked') == true) {
 		$('.selectItem').attr('checked', 'checked');
 	} else {
 		$('.selectItem').attr('checked', '');
 	}
 }
 /**
 * 删除
 */
 o.delBatch = function() {
 	var ids = "";
 	$('.selectItem').each( function() {
 		if ($(this).attr("checked")) {
 			if (ids == "")
 				ids = $(this).val();
 			else
 				ids = ids + "," + $(this).val();
 		}
 	});
 	if(ids==""){
 		alert("请选择要删除的记录!");
 		return;
 	}
 	$.ligerDialog.confirm('确定删除?', function(yes)
			{
				if(yes){
				 	$.ajax( {
				 		type : "POST",
				 		url : "faq-delBatch.action",
				 		data : "ids="+ids,
				 		success : function(msg) {
				 			window.location.reload(false);
				 		},
				 		error:function (XMLHttpRequest, textStatus, errorThrown) {
				 		    alert("出错了："+errorThrown);
				 		}
				 	});
				 }
				});
 }